package com.top.mall.main.income

import com.blankj.utilcode.util.ConvertUtils
import com.module.lemlin.owner.OwnerViewModeFragment
import com.top.mall.R
import com.top.mall.custom.GridSpacingItemDecoration
import com.top.mall.jetpack.vm.IncomeViewModel
import com.top.mall.main.income.adapter.CouponCenterAdapter
import kotlinx.android.synthetic.main.fragment_coupon.*

class CouponFragment : OwnerViewModeFragment<IncomeViewModel>() {

    companion object {
        fun newInstance(): CouponFragment {
            return CouponFragment()
        }
    }

    private val couponCenterAdapter: CouponCenterAdapter = CouponCenterAdapter()

    override val layoutResId: Int
        get() = R.layout.fragment_coupon

    override fun viewModel(): IncomeViewModel {
        return createViewModel()
    }

    override fun initView() {
        rvCouponBody.apply {
            addItemDecoration(GridSpacingItemDecoration(1, ConvertUtils.dp2px(13f)))
        }.adapter = couponCenterAdapter
    }

    override fun initData() {

//        val tables: MutableList<String> = mutableListOf<String>()
//        for (index in 0..10) {
//            tables.add(index.toString())
//        }
//        couponCenterAdapter.setNewInstance(tables)
    }

}